package com.bw.kf.mvvm

import com.bw.kf.mvvm.base.LoginMEntity
import com.bw.kf.mvvm.entity.IndexEntity
import com.bw.kf.mvvm.entity.LoginEntity
import com.bw.kf.mvvm.entity.ProductEntity
import com.bw.kf.mvvm.entity.ResetEntity
import com.bw.kf.mvvm.entity.SearchEntity
import com.bw.kf.mvvm.entity.SendCodeEntity
import com.bw.kf.mvvm.entity.UserEntity
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface APiText {
    @POST("/api/front/sendCode")
    suspend fun sendCode(@Query("phone") phone: String):SendCodeEntity
    @POST("/api/front/login/mobile")
    suspend fun login(@Body body:RequestBody):LoginEntity
    @GET("/api/front/user")
    suspend fun user(): UserEntity
    @POST("/api/front/register/reset")
    suspend fun reset(@Body body:RequestBody):ResetEntity
    @POST("/api/front/login")
    suspend fun Mlogin(@Body body: RequestBody):LoginMEntity
    @GET("/api/front/index")
    suspend fun index():IndexEntity
    @GET("/api/front/index/product/{type}")
    suspend fun product(@Path("type") type:Int,@Query("limit") limit:Int,@Query("page") page:Int): ProductEntity
    @GET("/api/front/products")
    suspend fun Search(@Query("cid") cid:Int,@Query("keyword") keyword:String,@Query("limit") limit:Int,@Query("news") news:Boolean,@Query("page") page:Int,@Query("priceOrder") priceOrder:String,@Query("salesOrder") salesOrder:String): ProductEntity
}